﻿using System.ComponentModel;

namespace Birkelund.QueryStrings
{
    /// <summary>
    /// Reasons for the querystring token parser to fail
    /// </summary>
    public enum FailureReason
    {
        /// <summary>
        /// The token key cannot be found in querystring (or the token exists but in a wrong casing)
        /// </summary>
        [Description("The specified token cannot be found in the querystring")]
        TokenDoesNotExist,

        /// <summary>
        /// The value cannot be parsed to correct datatype
        /// </summary>
        [Description("The token value cannot be parsed into correct type")]
        ParseError,

        /// <summary>
        /// Value can be parsed but has failed validation
        /// </summary>
        [Description("The token value does not meet the validation requirements")]
        ValidationError,

        /// <summary>
        /// CheckSum does not match with the keys and values. Url has been modified since the checksum was calculated
        /// </summary>
        [Description("The checksum doesn't match expected value")]
        CheckSumError,

        /// <summary>
        /// CheckSum token does not exist in the read url
        /// </summary>
        [Description("The token used for checksum control does not exist")]
        CheckSumTokenDoesNotExist,

        /// <summary>
        /// An error has occured while decrypting the querystring
        /// </summary>
        [Description("An error has occured while decrypting the querystring")]
        FullEncryptionError,

        /// <summary>
        /// The token representing the encrypted querystring cannot be found
        /// </summary>
        FullEncryptionTokenDoesNotExist,

        /// <summary>
        /// The token representing the encrypted querystring can be found, but is not the only token existing. This is required.
        /// </summary>
        FullEncryptionTokenIsNotTheOnlyToken
    }
}
